import { configureStore } from '@reduxjs/toolkit';

// 定义初始状态
const initialState = {
    data: {

    }
};

// 定义 reducer 函数，处理状态变化
const counterReducer = (state = initialState, action) => {
    switch (action.type) {
        case 'INSERT_DATA':
            return {
               ...state,
                data: action.payload
            };
        default:
            return state;
    }
};

// 使用 configureStore 创建 Redux store
const store = configureStore({
    reducer: {
        counter: counterReducer
    }
});

export default store;